package com.hl.wuyeguanliIDEA.service.impl;

import com.hl.wuyeguanliIDEA.mapper.UrgentNoticeMapper;
import com.hl.wuyeguanliIDEA.pojo.UrgentNotice;
import com.hl.wuyeguanliIDEA.service.UrgentNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class UrgentNoticeServiceImpl implements UrgentNoticeService {

    @Autowired
    private UrgentNoticeMapper urgentNoticeMapper;

    @Override
    public List<UrgentNotice> selectAll() {
        return urgentNoticeMapper.selectAll();
    }

    @Override
    public Optional<UrgentNotice> selectByPrimaryKey(Long id) {
        return Optional.ofNullable(urgentNoticeMapper.selectByPrimaryKey(id));
    }

    @Override
    public int add(UrgentNotice record) {
        return urgentNoticeMapper.add(record);
    }

    @Override
    public int update(UrgentNotice record) {
        return urgentNoticeMapper.update(record);
    }

    @Override
    public int delete(Long id) {
        return urgentNoticeMapper.delete(id);
    }
}